def sum_return_plus10(numbers)

sum = numbers.reduce(:+) 
plus_10 = numbers.reject {|x| x<10}

"The sum of the array is #{sum} and the numbers over 10 are #{plus_10}"
end

puts sum_return_plus10([3,5,1,2,7,9,8,13,25,32])


def shuffle_and_over5(names)

shuffle = names.shuffle
over5 = names.reject {|name| name.length < 5}

"Here's the list of names shuffled: #{shuffle} and here are the names longer than 5 letters #{over5}"
end

puts shuffle_and_over5(["John", "KB", "Oliver", "Cory", "Matthew", "Christopher"])

def alpha_shuffle()

alpha_shuffle = ('a'..'z').to_a.shuffle
first_last = alpha_shuffle[0], alpha_shuffle[25]
vowels = "aeiou"
	if vowels.include?(alpha_shuffle[0])
		return first_last, "The first letter is a vowel"
	else
		return first_last
	end


end

puts alpha_shuffle()


def rand_array10(num1, num2)
# in case the first number is bigger than second number
	if num1 > num2
		new_num1 = num2
		new_num2 = num1
		rand_array = (new_num1..new_num2).to_a.sample(10)
	else
		rand_array = (num1..num2).to_a.sample(10)
	end


	end

puts rand_array10(100,55)


def rand_array10(num1, num2)
# in case the first number is bigger than second number
	if num1 > num2
		new_num1 = num2
		new_num2 = num1
		rand_array = (new_num1..new_num2).to_a.sample(10).sort
		min_max = rand_array[0], rand_array[-1]
		"The sorted array is #{rand_array}. The minimum and maximum numbers are #{min_max}"
	else
		rand_array = (num1..num2).to_a.sample(10).sort
	min_max = rand_array[0], rand_array[-1]
	"The sorted array is #{rand_array}. The minimum and maximum numbers are #{min_max}"
	end

end

puts rand_array10(100, 55)


def rand_string(length)

(1..length).map {|x| x = (65+rand(26)).chr}.join('')

end

puts rand_string(5)

def rand_string_multiple(length_string, number_strings)
results = Array.new
$i = 0
	while $i < number_strings
		rand_string = (1..length_string).map {|x| x = (65+rand(26)).chr}.join('')
		results.push(rand_string)
		$i +=1	
	end
	return results
end

print rand_string_multiple(5, 10)

